package com.example.xd.tuiliu_test.videoplayer.widget.status;

import android.view.View;

import com.example.xd.tuiliu_test.R;
import com.example.xd.tuiliu_test.videoplayer.PlayerManager;
import com.example.xd.tuiliu_test.videoplayer.widget.BasePlayerView;

import tv.danmaku.ijk.media.player.IMediaPlayer;


public class WaitInitStatus extends BaseStatus {
    public WaitInitStatus(BasePlayerView view) {
        super(view);
    }

    @Override
    public void play() {
        view.initVideo();
        view.iv_screen_play.setVisibility(View.GONE);
        view.iv_video_pic.setVisibility(View.GONE);
        view.seek_play.setImageResource(R.drawable.pause);
        view.setStatus(view.initing);
        view.showLoading();
        PlayerManager.getInstance().setPlayingView(view);
    }

    public void restoreFromPlayerView() {
        releasePlayer();
    }

    @Override
    public void error() {

    }

    @Override
    public void completed() {

    }

    @Override
    public void onInfo(IMediaPlayer iMediaPlayer, int what, int i1) {

    }

    @Override
    public void netChange() {

    }

    @Override
    public void onBack() {

    }

    @Override
    public void onStart() {

    }

    @Override
    public void onPrepared(IMediaPlayer iMediaPlayer) {

    }

    @Override
    public void copyStatusToChild(BasePlayerView view) {
        view.setStatus(view.waitinit);
    }
}
